package com.alpha.core.utils;

import lombok.extern.slf4j.Slf4j;

import java.io.Closeable;
import java.io.IOException;

/**
 * Closeable 工具类
 *
 * @author chenruwan
 * @since 2022-01-01
 */
@Slf4j
@SuppressWarnings("unused")
public class Closeables {
    private Closeables() {
    }

    /**
     * 忽略 close 异常
     */
    public static void close(Closeable closeable) {
        try {
            closeable.close();
        } catch (IOException e) {
            log.error("close failed : ", e);
        }
    }
}
